package com.wanhe.mealbookmodule.injector.module;

import com.wanhe.base.injector.PerFragment;
import com.wanhe.base.injector.module.BaseApplicationModule;
import com.wanhe.mealbookmodule.adapter.CommonAdapter;
import com.wanhe.mealbookmodule.adapter.MealBookPagerAdapter;
import com.wanhe.mealbookmodule.fragment.MealBookFragment;
import com.wanhe.mealbookmodule.presenter.MealBookPresenter;

import dagger.Module;
import dagger.Provides;

/**
 * 
 * 菜单页面的module
 * 
 * @author 陈德基
 * @time 2017/6/22 11:44
 */
@Module
public class MealBookModule {

	private final MealBookPagerAdapter	mAdapter;
	private final MealBookFragment		mFragment;
	private final CommonAdapter mTypeAdapter;

	public MealBookModule(MealBookFragment fragment, MealBookPagerAdapter adapter, CommonAdapter typeAdapter) {
		this.mAdapter = adapter;
		this.mFragment = fragment;
		this.mTypeAdapter = typeAdapter;
	}

	@PerFragment
	@Provides
	public MealBookPresenter providePresenter(BaseApplicationModule.RxBus bus) {
		return new MealBookPresenter(mFragment, mAdapter, mTypeAdapter, bus);
	}

}
